﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Wanet.PublicPortal.Common.Managers
{
	public interface IManager<T>
	{
		/// <summary>
		/// Creates the specified item. After creation it reads just persisted item and return it back as a result.
		/// </summary>
		/// <param name="item">The item.</param>
		/// <returns></returns>
		T Create(T item);
		/// <summary>
		/// Gets the item by specified ID.
		/// </summary>
		/// <param name="id">The ID.</param>
		/// <returns></returns>
		T Get(int id);
		/// <summary>
		/// Gets the list of all items.
		/// </summary>
		/// <returns></returns>
		IList<T> GetAll();
		/// <summary>
		/// Updates the specified item. After update it returns back updated item as a result.
		/// </summary>
		/// <param name="item">The item.</param>
		/// <returns></returns>
		T Update(T item);
		/// <summary>
		/// Deletes the specified item. It returns true if the specified item is removed correctly; otherwise false.
		/// </summary>
		/// <param name="item">The item.</param>
		/// <returns></returns>
		bool Delete(T item);
	}
}
